import os
def list_files(path, indent=0, maxi=-1):
    if maxi != 0:
        try:
            lsdir = os.listdir(path)
        except Exception:
            pass
        else:
            for item in lsdir:
                if os.path.isdir(os.path.join(path, item)):
                    print(' ' * indent, "+", item)
                    list_files(os.path.join(path, item), indent + 4, maxi - 1)
                if os.path.isfile(os.path.join(path, item)):
                    print(' ' * indent, "-", item)
if __name__ == '__main__':
    file_path = r'E:\kubeasc'
    list_files(file_path)